import type { RouteRecordRaw } from "vue-router";

// 所有组件需要手动定义
export const Layout = () => import("@/layout/index.vue");

// 静态路由
export const constantRoutes: RouteRecordRaw[] = [
  {
    path: "/404",
    component: Layout,
    meta: { hidden: true },
    children: [
      {
        path: "",
        component: () => import("@/views/404/index.vue"),
      },
    ],
  },
  {
    path: "/login",
    component: () => import("@/views/login/index.vue"),
    meta: { hidden: true },
  },
  {
    path: "/",
    component: Layout,
    redirect: "/dashboard",
    children: [
      {
        path: "dashboard",
        component: () => import("@/views/dashboard/index.vue"),
        name: "Dashboard",
        meta: { title: "工作台", icon: "homepage", affix: true },
      },
    ],
  },
];